package com.runa.rccprotocol.dto.jjn;

import JjnCollectionDecode.DataDecode;
import JjnCollectionDecode.Results;
import com.runa.protocol.dto.DtuReportAck;
import com.runa.protocol.util.ByteUtil;

public class Jjn8124DataAck extends DtuReportAck {

    public Jjn8124DataAck(byte[] src, int offset) {
        data = new byte[18];
        System.arraycopy(src, offset, data, 0, 7);
        data[7] = 0x11;
        data[8] = 0x22;
        data[9] = 0x33;
        data[10] = 0x44;
        data[11] = 0x55;
        data[12] = 0x66;
        data[13] = 1;
        data[16] = ByteUtil.sum(data, 0, 16);
        data[17] = 0x16;
        DataDecode decode = new DataDecode();
        Results results = decode.dataEncode(ByteUtil.byteToHexString(data));
        if (results.returnResult) {
            System.out.println(results.returnData);
            data = results.returnData.getBytes();
        } else {
            data = null;
        }
    }
}
